#ifndef __LIB_GUI_BUTTON_H
#define __LIB_GUI_BUTTON_H

#include"gui_spirit.h"
#include"gui_color.h"

#define GUI_BUTTON_COLOR_IDLE_FIXED 0x01
#define GUI_BUTTON_COLOR_TOUCH_FIXED 0x02
#define GUI_BUTTON_COLOR_CLICK_FIXED 0x04

#define GUI_BUTTON_SIZE_FIXED 0x01

typedef enum 
{
    GUI_BUTTON_IDLE=0,
    GUI_BUTTON_TOUCH,
    GUI_BUTTON_CLICK,
}gui_button_status_t;

typedef struct 
{ 
    gui_spirit_t  spirit;
    gui_button_status_t status;
    gui_color_t color_idle;
    gui_color_t color_touch;
    gui_color_t color_click;
    gui_color_t color_disable;
    int disable;
    int flags;
    list_t list;
}gui_button_t;


#define GUI_BUTTON(spirit) ((gui_button_t*)(spirit))

#define GUI_BUTTON_WIDTH_DEFAULT 48
#define GUI_BUTTON_HEIGHT_DEFAULT 24

gui_spirit_t *gui_button_create();
gui_spirit_t *gui_button_create_with_label(char *label);
int gui_button_set_disable(gui_button_t *button);
int gui_button_set_enable(gui_button_t *button);
void gui_button_change_status(gui_button_t *button, gui_button_status_t status);
void gui_button_set_title(gui_button_t *button,char *text);

#endif